<?php
$this->breadcrumbs = array(
    'Cms',
);
?>
<div>
	<div class="pull-right">
                <div class="btn-group span2">
                    <form>
                         <?php echo CHtml::dropDownList('language_id',  isset($_GET['language_id']) ? $_GET['language_id'] : 1, MyFunctionCustom::getLanguage(),array('style'=>'width:120px;margin-top:4px;','onchange'=>'this.form.submit();')) ?>
                    </form>
               </div>

 		<div class="widget-toolbar">
			<a href="<?php echo Yii::app()->createAbsoluteUrl($parentUrl . '/create'); ?>" role="button" class="white" data-toggle="modal"  title="Add new language">
				<i class="icon-plus"></i>
			</a>
		</div>

	</div>
</div>
<div class="row-fluid">
    <div class="table-header">
        Cms Management
    </div>


    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th width="40">S/N</th>
                <th>Name</th>
                <th>Type</th>
                <th></th>
            </tr>
        </thead>

        <tbody>
             <?php
                    $type = MyFunctionCustom::getPagetype();
                    if (count($data) > 0):
                        foreach ($data as $k=> $item) :
              ?> 
                <tr>
                    <td class="center">
                        <label>
                            <?php echo $k+1; ?>
                        </label>
                    </td>
                    <td>
                        <b class="blue"><?php echo $item->name ?></b>
                    </td>
                    <td>
                        <?php echo (!is_null($item->page_type)) ? ucfirst($item->page_type) : '';  ?>
                    </td>

                    <td class="td-actions">
                                    <div class="hidden-phone visible-desktop action-buttons">
                                        <a class="blue" href="<?php echo Yii::app()->createAbsoluteUrl($parentUrl . '/view', array('id' => $item->id)); ?>">
                                            <i class="icon-zoom-in bigger-130"></i>
                                        </a>
                                        <a class="green" href="<?php echo Yii::app()->createAbsoluteUrl($parentUrl . '/update', array('id' => $item->id)); ?>">
                                            <i class="icon-pencil bigger-130"></i>
                                        </a>
                                    </div>
                                    <div class="hidden-desktop visible-phone">
                                        <div class="inline position-relative">
                                            <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
                                                <i class="icon-caret-down icon-only bigger-120"></i>
                                            </button>
                                            <ul class="dropdown-menu dropdown-icon-only dropdown-yellow pull-right dropdown-caret dropdown-close">
                                                <li>
                                                    <a href="<?php echo Yii::app()->createAbsoluteUrl($parentUrl . '/view', array('id' => $item->id)); ?>" class="tooltip-info" data-rel="tooltip" title="View">
                                                        <span class="blue">
                                                            <i class="icon-zoom-in bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>
                                                <li>
                                                    <a href="<?php echo Yii::app()->createAbsoluteUrl($parentUrl . '/update', array('id' => $item->id,'language_id'=>$item->language_id)); ?>" class="tooltip-success" data-rel="tooltip" title="Edit">
                                                        <span class="green">
                                                            <i class="icon-edit bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>

                                            </ul>
                                        </div>
                                    </div>
                                </td>                 

                    
                </tr>
            <?php endforeach;endif; ?> 
        </tbody>
    </table>
</div>